﻿@model HelloMinasan.Web.Song.ViewModels.ModelForList<HelloMinasan.Domain.User>
<div align="center">
    @foreach (var item in Model.ListItem)
    {
        <div class="iconSong userIcon">
            <img src="@item.Avatar" width="60" height="80" />
            <br />
            <div class="titleSong" style="height:auto !important"><i><b>@item.Username</b></i></div>
            <div><b>@item.Fullname</b></div>
            <div class="controlAdminItems" style="position:initial" align="center">
                <a href="/Account/UserInformation/@item.Username">
                    <img class="backgroundLinear" src="~/Content/Images/informationIcon.png" width="25" />
                </a>
                @if (!item.IsLocked)
                {
                    <img onclick="lockUser('@item.Username', @Model.PagingControl.CurrentPageNumber, true)" class="backgroundLinear" src="~/Content/Images/admin_icon/lock.png" width="25" />
                }
                else
                {
                    <img onclick="lockUser('@item.Username', @Model.PagingControl.CurrentPageNumber, false)" class="backgroundLinear" src="~/Content/Images/admin_icon/unlock.png" width="25" />
                }
            </div>
        </div>
    }
    <div align="left" style="margin-top: 10px;">
    @if (@Model.PagingControl.PreviousPageNumber > 0)
    {
        <a onclick="gotoUserAdminPage(1)" class="buttonClass">First</a>
        <a onclick="gotoUserAdminPage(@Model.PagingControl.PreviousPageNumber)" class="buttonClass">Back</a>
    }
    <select onchange="jumpToPage(this)">
        @for (int i = 1; i <= Model.TotalPageCount; i++)
        {
            if (i != Model.PagingControl.CurrentPageNumber)
            { <option value="@i">@i</option> }
            else
            { <option value="@i" selected>@i</option> }
        }
    </select>
    @if (@Model.PagingControl.NextPageNumber <= Model.TotalPageCount)
    {
        <a onclick="gotoUserAdminPage(@Model.PagingControl.NextPageNumber)" class="buttonClass">Next</a>
        <a onclick="gotoUserAdminPage(@Model.TotalPageCount)" class="buttonClass">Last</a>
    }
</div>
</div>
